<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>

<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
	<%
			Long offset=(Long)request.getAttribute("offset");
	%>
    <form:form  action="${contextPath}/admin/adminUser/query" id="form1" method="get">
        <table class="${tableclass}" style="width: 100%">
		    <thead>
		    	<tr>
			    	<th>
				    	<a href="<ls:url address='/admin/index'/>" target="_parent">权限管理</a>  &raquo; 
				    	<a href="<ls:url address='/admin/adminUser/query'/>">成员列表</a>
			    	</th>
		    	</tr>
		    </thead>
		    <tbody><tr><td>
		    	    <div align="left" style="padding: 3px">
				       	    <input type="hidden" id="curPageNO" name="curPageNO" value="${curPageNO}" />
				       	    &nbsp; 成员名
							<input class="${inputclass}" type="text" name="name" maxlength="50" value="${bean.name }" />
							&nbsp; 姓名
							<input class="${inputclass}" type="text" name="realName" maxlength="50" value="${bean.realName }" />
						&nbsp;     上级姓名
						    <input class="${inputclass}" type="text" name="leaderName" maxlength="50" value="${bean.leaderName }" />
								&nbsp;状态 
								<select id="enabled" name="enabled"  class="${selectclass}">
								  <ls:optionGroup type="select" required="false" cache="true"  beanName="ENABLED" selectedValue="${bean.enabled}"/>
					            </select>

							&nbsp;是否需要填写周报
							<select id="needDailyLog" name="needDailyLog"  class="${selectclass}">
								<ls:optionGroup type="select" required="false" cache="true"  beanName="YES_NO" selectedValue="${bean.needDailyLog}"/>
							</select>

				            <input type="button" onclick="search()"  class="${btnclass}"  value="搜索"/>
				            <input type="button"  class="${btnclass}"  value="创建成员" onclick='window.location="<ls:url address='/admin/adminUser/load'/>"'/>
				      </div>
		     </td></tr></tbody>
	    </table>
    </form:form>
    <div align="center">
          <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
		<display:table name="list" requestURI="/admin/adminUser/query" id="item" export="false" sort="external" class="${tableclass}" style="width:100%">
	    	<display:column title="顺序"  class="orderwidth"><%=offset++%></display:column>
     		<display:column title="成员名" property="name"></display:column>
     		<display:column title="姓名" property="realName"></display:column>
			<display:column title="上级姓名" property="leaderName"></display:column>
			<display:column title="周报"><ls:optionGroup type="label" required="true" cache="true" beanName="YES_NO" selectedValue="${item.needDailyLog}" defaultDisp=""/></display:column>
			<display:column title="性别"><ls:optionGroup type="label" required="true" cache="true" beanName="STAFF_SEX" selectedValue="${item.sex}"/></display:column>
     		<display:column title="状态" >
     		      <ls:optionGroup type="label" required="true" cache="true"
	                beanName="ENABLED" selectedValue="${item.enabled}" defaultDisp=""/>
     		</display:column>
      <display:column title="用户角色">
      	<a href="<ls:url address='/admin/member/user/roles/${item.id}?appNo=BACK_END'/>">用户角色</a>
      </display:column>
      <display:column title="用户权限">
      	<a href="<ls:url address='/admin/member/user/functions/${item.id}?appNo=BACK_END'/>" >用户权限</a>
      </display:column>
	      <display:column title="修改密码">
	      	<a href="<ls:url address='/admin/member/user/update/${item.id}?appNo=BACK_END'/>">修改密码</a>  
	      </display:column>

	      <display:column title="操作" media="html" style="width:235px">
	      	<div class="am-btn-toolbar">
			  <div class="am-btn-group am-btn-group-xs">
					<button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="window.location='${contextPath}/admin/adminUser/load/${item.id}'"><span class="am-icon-pencil-square-o"></span> 修改</button>
					<button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="deleteById('${item.id}')" ><span class="am-icon-trash-o"></span> 删除</button>
			  </div>
			</div>
	      </display:column>
	      
	      
	    </display:table>
       <ls:page pageSize="${pageSize }"  total="${total}" curPageNO="${curPageNO }"  type="default"/> 
    </div>
        <script language="JavaScript" type="text/javascript">
			<!--
			  function deleteById(id) {
			      if(confirm("  确定删除吗 ?")){
			            window.location = "<ls:url address='/admin/adminUser/delete/" + id + "'/>";
			        }
			    }
			
			        function pager(curPageNO){
			            document.getElementById("curPageNO").value=curPageNO;
			            document.getElementById("form1").submit();
			        }
			        function search(){
					  	$("#form1 #curPageNO").val("1");//只要是搜索,都是从第一页开始查
					  	$("#form1")[0].submit();
					}
			//-->
		</script>

